﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<section>
    <div class="page-header">
        <h1>Início</h1>
    </div>

    <div class="row-fluid m-fluid">
        <div class="span6 m-widget">
            <div class="m-widget-header">
                <h3>Novo Atendimento</h3>
            </div>
            <div class="m-widget-body">
                <form class="form-horizontal">
                    <div class="control-group">
                        <label class="control-label" for="inputEmail">Paciente</label>
                        <div class="controls">
                            <input type="text" id="Paciente" placeholder="Procurar por Nome">
                            <input type="hidden" id="PacienteId" />
                            <script>
                                $("#Paciente").typeahead({
                                    source: function (query, process) {
                                        return $.get('/Pacientes/FindByName',
                                            { query: query },
                                            function (json) {
                                                if (json) {
                                                    var results = []

                                                    if (json instanceof Array) {
                                                        $.each(json, function () {
                                                            results.push(this.Nome)
                                                        })
                                                    } else {
                                                        results.push(json.Nome)
                                                    }

                                                    return process(results)
                                                }
                                            }
                                        )
                                    }
                                })
                            </script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="inputPassword">Médico</label>
                        <div class="controls">
                            <input type="text" id="Medico" placeholder="Procurar por Nome">
                            <input type="hidden" id="MedicoId" />
                            <script>
                                $("#Medico").typeahead({
                                    source: function (query, process) {
                                        return $.get('/Medicos/FindByName',
                                            { query: query },
                                            function (json) {
                                                if (json) {
                                                    var results = []

                                                    if (json instanceof Array) {
                                                        $.each(json, function () {
                                                            results.push(this.Nome)
                                                        })
                                                    } else {
                                                        results.push(json.Nome)
                                                    }

                                                    return process(results)
                                                }
                                            }
                                        )
                                    }
                                })
                            </script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="dataAgendamento">Data</label>
                        <div class="controls">
                            <input type="date" id="dataAgendamento" placeholder="">
                        </div>
                    </div>

                    <script>
                        $(function () {
                            $("#dataAgendamento").datepicker();
                        })
                    </script>

                    <div class="control-group">
                        <label class="control-label" for="inputPassword">Horário</label>
                        <div class="controls">
                            <input type="text" id="Horario" placeholder="">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="inputPassword">Observação</label>
                        <div class="controls">
                            <textarea type="text" id="Observacao"></textarea>
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="controls">
                            <button type="submit" class="btn btn-success" />
                            Encaminhar</button>
                            <button type="submit" class="btn" />
                            Cancelar</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="span6 m-widget">
            <div class="m-widget-header">
                <h3>Atendimentos Agendados</h3>
            </div>
            <div class="m-widget-body">
                <div class="row-fluid">
                    <div class="btn-group" data-toggle="buttons-radio">
                        <button data="data1" class="btn btn-chart active">Hoje</button>
                        <button data="data2" class="btn btn-chart">Esta Semana</button>
                        <button data="data3" class="btn btn-chart">Este Mês</button>
                    </div>
                </div>
                <hr class="hr-invisible" />
                <table class="table table-striped table-condensed">
                    <thead>
                        <tr>
                            <th>Data e Hora</th>
                            <th>Paciente</th>
                            <th>Médico</th>
                            <th>&nbsp;</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>28/02 &middot; 10h30</td>
                            <td><a href="#">Nelson Freitas</a></td>
                            <td><a href="#">Dráuzio Varella</a></td>
                            <td class="tr">
                                <a href="#" class="btn btn-primary">Abrir</a>
                            </td>
                        </tr>
                        <tr>
                            <td>28/02 &middot; 10h50</td>
                            <td><a href="#">Adalgiza Machado</a></td>
                            <td><a href="#">Dráuzio Varella</a></td>
                            <td class="tr">
                                <a href="#" class="btn btn-primary">Abrir</a>
                            </td>
                        </tr>
                        <tr>
                            <td>28/02 &middot; 11h10</td>
                            <td><a href="#">Célio Rodrigo</a></td>
                            <td><a href="#">Dráuzio Varella</a></td>
                            <td class="tr">
                                <a href="#" class="btn btn-primary">Abrir</a>
                            </td>
                        </tr>
                        <tr>
                            <td>28/02 &middot; 11h40</td>
                            <td><a href="#">Kariellen França</a></td>
                            <td><a href="#">Regina Bittencourt</a></td>
                            <td class="tr">
                                <a href="#" class="btn btn-primary">Abrir</a>
                            </td>
                        </tr>
                        <tr>
                            <td>28/02 &middot; 12h00</td>
                            <td><a href="#">Adalberto Mathias</a></td>
                            <td><a href="#">Regina Bittencourt</a></td>
                            <td class="tr">
                                <a href="#" class="btn btn-primary">Abrir</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <a href="#" class="btn btn-link">Ver todos</a>

                <div id="line-chart">
                </div>
            </div>
        </div>
    </div>

    <div class="row-fluid">
        <div class="span4 m-widget">
            <div class="m-widget-header">
                <h3>Postos de Saúde</h3>
            </div>
            <div class="m-widget-body">
                <table class="table table-striped table-condensed">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Referência</th>
                            <th>&nbsp;</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>#0001</td>
                            <td><a href="#">Bairro AABB</a></td>
                            <td class="tr">
                                <a href="#" class="btn btn-primary">Abrir</a>
                            </td>
                        </tr>
                        <tr>
                            <td>#0002</td>
                            <td><a href="#">Rua Vereador Arnaldo</a></td>
                            <td class="tr">
                                <a href="#" class="btn btn-primary">Abrir</a>
                            </td>
                        </tr>
                        <tr>
                            <td>#0003</td>
                            <td><a href="#">Rua Padre Cícero</a></td>
                            <td class="tr">
                                <a href="#" class="btn btn-primary">Abrir</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <a href="#" class="btn btn-link">Ver todos</a>
            </div>
        </div>

        <div class="span8 m-widget">
            <div class="m-widget-header">
                <h3>Estatísticas deste Mês</h3>
            </div>

            <div class="m-widget-body">
                <div class="row-fluid">
                    <a href="#" class="span3 m-stats-item">
                        <span class="m-stats-val">200+</span>
                        Atendimentos Agendados
                    </a>

                    <a href="#" class="span3 m-stats-item">
                        <span class="m-stats-val">50</span>
                        Medicamentos Adquiridos
                    </a>

                    <a href="#" class="span3 m-stats-item">
                        <span class="m-stats-val">100+</span>
                        Medicamentos Distribuídos
                    </a>

                    <a href="#" class="span3 m-stats-item">
                        <span class="m-stats-val">1000</span>
                        Novos Pacientes Cadastrados
                    </a>
                </div>
            </div>
        </div>
    </div>
</section>
